home *** CD-ROM | disk | FTP | other *** search
- /* Script Rexx
- AnimPainting for Box*/
-
- call addlib("rexxmathlib.library", 5, -30, 0)
-
- options results
- parse ARG Port x1 y1 x2 y2 b
-
- ADDRESS COMMAND
- sens=0
- if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/AnimPainting_Box') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/AnimPainting_Box', "R") then DO
- sens = READLN('lfile')
- CALL CLOSE('lfile')
- END
- END
-
- ADDRESS value Port
- pp_DialogInit 250 60 "*AnimPainting*Box*" 1
- pp_Cycle 0 100 8 100 16 "Order" 1 "--->|<---" sens
- pp_Dialog
- rc=result
- if rc=0 then
- do
- EXIT
- end
-
- pp_GetDialog 0
- sens=result
-
- CALL SavePrefs('AnimPainting_Box',sens)
- ADDRESS value Port
-
- IF x1>x2 then DO
- x=x1
- x1=x2
- x2=x
- END
- IF y1>y2 then DO
- y=y1
- y1=y2
- y2=y
- END
-
-
- pp_CountFrames
- nb=result
- IF nb<2 then DO
- pp_Warn 'Make*an*Anim*first.'
- EXIT
- END
-
- if sens=0 THEN DO
- DO x=x1 to x2
- pp_Plot x y1
- pp_NextFrame
- END
-
- DO y=y1+1 to y2
- pp_Plot x2 y
- pp_NextFrame
- END
-
- DO x=x2-1 to x1 by -1
- pp_Plot x y2
- pp_NextFrame
- END
-
- DO y=y2-1 to y1+1 by -1
- pp_Plot x1 y
- pp_NextFrame
- END
- END
- ELSE
- DO
- DO x=x2 to x1 by -1
- pp_Plot x y1
- pp_NextFrame
- END
-
- DO y=y1+1 to y2
- pp_Plot x1 y
- pp_NextFrame
- END
-
- DO x=x1+1 to x2
- pp_Plot x y2
- pp_NextFrame
- END
-
- DO y=y2-1 to y1+1 by -1
- pp_Plot x2 y
- pp_NextFrame
- END
- END
-
- EXIT
-
- SavePrefs: PROCEDURE
-
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
-
- if EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
-
- do i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- end
-
- CALL CLOSE('pfile')
-
- RETURN
-